1 <md-dialog class="whatsappAccount-dialog" aria-label="New WhatsappAccount">
 
   2   <form name="whatsappAccountForm" class="md-inline-form" novalidate>
 
   3     <md-toolbar class="md-accent md-hue-2">
 
   5         class="md-toolbar-tools"
 
   7         layout-align="space-between center"
 
   9         <span class="title">{{ vm.title | translate }}</span>
 
  10         <md-button class="md-icon-button" ng-click="vm.closeDialog()">
 
  12             md-font-icon="icon-close"
 
  13             aria-label="Close dialog"
 
  19     <md-dialog-content ms-scroll>
 
  20       <div class="error-list">
 
  22           ng-repeat="error in vm.errors"
 
  25           layout-align="space-between center"
 
  28             <span class="message">{{error.message}}</span>
 
  29             <span class="type">({{error.type}})</span>
 
  31           <md-button class="md-icon-button">
 
  33               md-font-icon="icon-alert-box"
 
  34               aria-label="alert error"
 
  40       <md-input-container class="md-block">
 
  41         <label translate="WHATSAPP.NAME">Name</label>
 
  45           ng-model="vm.whatsappAccount.name"
 
  48           ng-disabled="!vm.newWhatsappAccount"
 
  51         <div class="hint"><span translate="WHATSAPP.HELP.NAME"></span></div>
 
  53           ng-messages="whatsappAccountForm['name'].$error"
 
  54           ng-show="whatsappAccountForm['name'].$touched"
 
  57           <div ng-message="required">
 
  58             <span translate="WHATSAPP.ERRORS.NAME_REQUIRED"
 
  59               >Name field is required</span
 
  64       <md-input-container class="md-block">
 
  65         <label translate="WHATSAPP.KEY">key</label>
 
  69           ng-model="vm.whatsappAccount.key"
 
  75           ng-messages="whatsappAccountForm['key'].$error"
 
  76           ng-show="whatsappAccountForm['key'].$touched"
 
  79           <div ng-message="required">
 
  80             <span translate="WHATSAPP.ERRORS.KEY_REQUIRED"
 
  81               >key field is required</span
 
  84           <div ng-message="md-maxlength">
 
  86               translate="WHATSAPP.ERRORS.KEY_MAX_LENGTH"
 
  87               translate-values="{max: 5}"
 
  88               >key must have a maximum length equal to 5</span
 
  93       <md-input-container class="md-block">
 
  94         <label translate="WHATSAPP.LIST">List</label>
 
  95         <md-select name="ListId" ng-model="vm.whatsappAccount.ListId" required>
 
  98             ng-repeat="ListId in vm.lists"
 
  99             ng-disabled="ListId.canSelect === false"
 
 100             >{{ ListId.name }}</md-option
 
 103         <div class="hint"><span translate="WHATSAPP.HELP.LIST"></span></div>
 
 105           ng-messages="whatsappAccountForm['ListId'].$error"
 
 106           ng-show="whatsappAccountForm['ListId'].$touched"
 
 109           <div ng-message="required">
 
 110             <span translate="WHATSAPP.ERRORS.LIST_REQUIRED"
 
 111               >List field is required</span
 
 115       </md-input-container>
 
 116       <md-input-container class="md-block">
 
 117         <label translate="WHATSAPP.MOTIONPROXY">MotionProxy</label>
 
 121           ng-model="vm.whatsappAccount.remote"
 
 127           <span translate="WHATSAPP.HELP.MOTIONPROXY"></span>
 
 130           ng-messages="whatsappAccountForm['remote'].$error"
 
 131           ng-show="whatsappAccountForm['remote'].$touched"
 
 134           <div ng-message="required">
 
 135             <span translate="WHATSAPP.ERRORS.MOTIONPROXY_REQUIRED"
 
 136               >MotionProxy field is required</span
 
 139           <div ng-message="url">
 
 140             <span translate="WHATSAPP.ERRORS.MOTIONPROXY_MUST_VALID_URL"
 
 141               >MotionProxy must be a valid url http://www.xcally.com</span
 
 144           <div ng-message="md-maxlength">
 
 146               translate="WHATSAPP.ERRORS.MOTIONPROXY_MAX_LENGTH"
 
 147               translate-values="{max: 255}"
 
 148               >MotionProxy must have a maximum length equal to 255</span
 
 152       </md-input-container>
 
 153       <md-input-container class="md-block">
 
 154         <label translate="WHATSAPP.TYPE">Type</label>
 
 155         <md-select name="type" ng-model="vm.whatsappAccount.type">
 
 156           <md-option ng-value="'twilio'">Twilio</md-option>
 
 159           ng-messages="whatsappAccountForm['type'].$error"
 
 160           ng-show="whatsappAccountForm['type'].$touched"
 
 163           <div ng-message="required">
 
 164             <span translate="WHATSAPP.ERRORS.TYPE_REQUIRED"
 
 165               >Type field is required</span
 
 169       </md-input-container>
 
 171         ng-if="vm.whatsappAccount.type == 'twilio'"
 
 174         <label translate="WHATSAPP.ACCOUNTSID">AccountSID</label>
 
 178           ng-model="vm.whatsappAccount.accountSid"
 
 183           ng-messages="whatsappAccountForm['accountSid'].$error"
 
 184           ng-show="whatsappAccountForm['accountSid'].$touched"
 
 187           <div ng-message="required">
 
 188             <span translate="WHATSAPP.ERRORS.ACCOUNTSID_REQUIRED"
 
 189               >AccountSID field is required</span
 
 193       </md-input-container>
 
 195         ng-if="vm.whatsappAccount.type == 'twilio'"
 
 198         <label translate="WHATSAPP.AUTHTOKEN">AuthToken</label>
 
 202           ng-model="vm.whatsappAccount.authToken"
 
 207           ng-messages="whatsappAccountForm['authToken'].$error"
 
 208           ng-show="whatsappAccountForm['authToken'].$touched"
 
 211           <div ng-message="required">
 
 212             <span translate="WHATSAPP.ERRORS.AUTHTOKEN_REQUIRED"
 
 213               >AuthToken field is required</span
 
 217       </md-input-container>
 
 218       <md-input-container class="md-block">
 
 219         <label translate="WHATSAPP.PHONE">phone</label>
 
 223           ng-model="vm.whatsappAccount.phone"
 
 228           ng-messages="whatsappAccountForm['phone'].$error"
 
 229           ng-show="whatsappAccountForm['phone'].$touched"
 
 232           <div ng-message="required">
 
 233             <span translate="WHATSAPP.ERRORS.PHONE_REQUIRED"
 
 234               >phone field is required</span
 
 238       </md-input-container>
 
 239       <md-input-container class="md-block">
 
 240         <label translate="WHATSAPP.DESCRIPTION">Description</label>
 
 244           ng-model="vm.whatsappAccount.description"
 
 248           ng-messages="whatsappAccountForm['description'].$error"
 
 249           ng-show="whatsappAccountForm['description'].$touched"
 
 252           <div ng-message="required">
 
 253             <span translate="WHATSAPP.ERRORS.DESCRIPTION_REQUIRED"
 
 254               >Description field is required</span
 
 258       </md-input-container>
 
 260       <div class="error-list">
 
 262           ng-repeat="error in vm.errors"
 
 265           layout-align="space-between center"
 
 268             <span class="message">{{error.message}}</span>
 
 269             <span class="type">({{error.type}})</span>
 
 271           <md-button class="md-icon-button">
 
 273               md-font-icon="icon-alert-box"
 
 274               aria-label="alert error"
 
 284       layout-align="space-between center"
 
 285       ng-if="!vm.crudPermissions.readOnly"
 
 287       <div layout="row" layout-align="start center">
 
 290           ng-if="vm.crudPermissions.canEdit && !vm.newWhatsappAccount"
 
 291           ng-click="vm.saveWhatsappAccount()"
 
 292           class="send-button md-accent md-raised"
 
 293           ng-disabled="whatsappAccountForm.$invalid || whatsappAccountForm.$pristine"
 
 295           translate="WHATSAPP.SAVE"
 
 296           translate-attr-aria-label="WHATSAPP.SAVE"
 
 303           ng-if="vm.crudPermissions.canEdit && vm.newWhatsappAccount"
 
 304           ng-click="vm.addNewWhatsappAccount()"
 
 305           class="send-button md-accent md-raised"
 
 306           ng-disabled="whatsappAccountForm.$invalid"
 
 308           translate="WHATSAPP.ADD_WHATSAPPACCOUNT"
 
 309           translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPACCOUNT"
 
 316           class="md-icon-button"
 
 317           ng-if="vm.crudPermissions.canDelete && !vm.newWhatsappAccount"
 
 318           ng-click="vm.deleteWhatsappAccount($event)"
 
 321           translate-attr-aria-label="WHATSAPP.DELETE"
 
 323           <md-icon md-font-icon="icon-delete"></md-icon>
 
 325             ><span translate="WHATSAPP.DELETE">DELETE</span></md-tooltip